#include <stdio.h>

int
my_atoi(const char *nptr)
{
  int n = 0;
  for (; *nptr >= '0' && *nptr <= '9'; nptr++)
    n = n * 10 + *nptr - '0';
  return n;
}

main()
{
  printf("%d\n", my_atoi("1234"));
}
